/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Golf_Manager.vo;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class GroupDesc {
    
    private String gDate;
    private String gKey;
    private String gOrder;
    private String gRecYn;

    public GroupDesc(String gDate, String gKey, String gOrder, String gRecYn) {
        this.gDate = gDate;
        this.gKey = gKey;
        this.gOrder = gOrder;
        this.gRecYn = gRecYn;
    }

    public String getgDate() {
        return gDate;
    }

    public void setgDate(String gDate) {
        this.gDate = gDate;
    }

    public String getgKey() {
        return gKey;
    }

    public void setgKey(String gKey) {
        this.gKey = gKey;
    }

    public String getgOrder() {
        return gOrder;
    }

    public void setgOrder(String gOrder) {
        this.gOrder = gOrder;
    }

    public String getgRecYn() {
        return gRecYn;
    }

    public void setgRecYn(String gRecYn) {
        this.gRecYn = gRecYn;
    }
    
    @Override
	public String toString() {
		Class cls = this.getClass();
		Method[] arrMethod = cls.getMethods();
		StringBuilder sb = new StringBuilder(this.getClass().toString());
		sb.append(" => ");
		
		try {
			for(Method m : arrMethod) {
				if(m.getName().startsWith("get") && !m.getName().equals("getClass")) { 
					sb.append(m.getName());
					sb.append(": ");
					sb.append(m.invoke(this));
					sb.append(", ");
				}
			}
		} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
			Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, e);
		}
		
		return sb.toString().substring(0, sb.length() - 2);
	}
}
